package com.ffws.base.exception;

/**
 * @Author JC
 * @description 本项目自定义异常类型
 * @Date 2023-8-12 00:36
 * @Version 1.0
 */
public class FFWSException extends RuntimeException {

    private String errMessage;

    public FFWSException() {
    }

    public String getErrMessage() {
        return errMessage;
    }

    public void setErrMessage(String errMessage) {
        this.errMessage = errMessage;
    }

    public FFWSException(String message) {
        super(message);
        this.errMessage = message;
    }

    public static void cast(String message) {
        throw new FFWSException(message);
    }

    public static void cast(CommonError error) {
        throw new FFWSException(error.getErrMessage());
    }
}
